package cc.rengu.igas.channel.ncqs.common.enums;

import org.springframework.util.StringUtils;

/**
 * 银联无卡快捷网络管理枚举 on 2019/10/22.
 */
public enum NcqsNetStatusManageEnum {

    SIGN_IN("01", "签到机构"),
    SIGN_OUT("02", "签退机构"),
    SIGN_IN_ACQUIRER("03", "签到受理侧机构"),
    SIGN_OUT_ACQUIRER("04", "签退受理侧机构"),
    SIGN_IN_ISSUER("05", "签到发卡侧机构"),
    SIGN_OUT_ISSUER("06", "签退发卡侧机构"),
    SIGN_IN_RESERVE("07", "签到备付金机构"),
    SIGN_OUT_RESERVE("08", "签退备付金机构"),
    ;

    private String type;
    private String desc;

    NcqsNetStatusManageEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static NcqsNetStatusManageEnum getNcqsNetStatusManageEnumByType(String type) {
        if (StringUtils.isEmpty(type)) {
            return null;
        }

        for (NcqsNetStatusManageEnum tmp : values()) {
            if (tmp.getType().equals(type)) {
                return tmp;
            }
        }
        return null;
    }


}
